package com.le.tester;

import com.le.tester.entity.Product;
import com.le.tester.sevice.ProductService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * createTime：2022/11/9 10:26
 * description：事务回滚
 */
@SpringBootTest
@RunWith(SpringRunner.class)
public class UseTransactional {

    @Autowired
    private ProductService productService;


    @Test
    public void exec() {
        Product product = new Product();
        product.setId(1L);
        product.setProductName("test");
        productService.saveProduct(product);
    }
}
